<?php

// +----------------------------------------------------------------------
// |Author: 翼小菜
// +----------------------------------------------------------------------
// |Description: cve-admin API路由
// +----------------------------------------------------------------------
// |更多功能可联系QQ314688769
// +----------------------------------------------------------------------

use think\facade\Route;

Route::get('cveadmin/admin_app/apps$', 'cveadmin/AdminApp/index');
Route::post('cveadmin/admin_app/apps/:name$', 'cveadmin/AdminApp/install');
Route::put('cveadmin/admin_app/apps/:name$', 'cveadmin/AdminApp/update');
Route::delete('cveadmin/admin_app/apps', 'cveadmin/AdminApp/uninstall');

Route::get('cveadmin/systeminfo$', 'cveadmin/Index/index');
Route::put('cveadmin/avatar$', 'cveadmin/Avatar/saveAvatar');//更新头像

//Route::get('cveadmin/admin_menu/index','cveadmin/admin_menu/index');//获取菜单

Route::post('cveadmin/admin_menus/lang/export$', 'cveadmin/AdminMenu/exportMenuLang');
Route::post('cveadmin/admin_menus/list/order$', 'cveadmin/AdminMenu/listOrder');
Route::get('cveadmin/home/admin_menus$', 'cveadmin/AdminMenu/menus');
Route::resource('cveadmin/admin_menus', 'cveadmin/AdminMenu');
Route::post('cveadmin/admin_menus/import', 'cveadmin/AdminMenu/importMenus');
Route::post('cveadmin/admin_menus/:id/toggle$', 'cveadmin/AdminMenu/toggle')->pattern(['id' => '\d+',]);


Route::post('cveadmin/login$','cveadmin/Public/login');//后台登录
Route::post('cveadmin/logout$','cveadmin/Public/logout');//后台退出

Route::get('cveadmin/asset/getAssets$','cveadmin/asset/getAssets');//获取资源

Route::get('cveadmin/admin_rbac/:id/api/authorize$', 'cveadmin/admin_rbac/apiAuthorize');//获取cveadmin后台API授权信息
Route::put('cveadmin/admin_rbac/:id/api/authorize$', 'cveadmin/admin_rbac/apiAuthorizePut');//提交修改cveadmin后台API授权
Route::get('cveadmin/admin_rbac/:id/authorize$', 'cveadmin/admin_rbac/authorize');//获取cveadmin后台菜单授权信息
Route::put('cveadmin/admin_rbac/:id/authorize$', 'cveadmin/admin_rbac/authorizePut');//提交cveadmin后台菜单授权
Route::resource('cveadmin/admin_rbac', 'cveadmin/AdminRbac');

Route::get('cveadmin/admin_users/:id/get/users','cveadmin/AdminUser/getUsers');//根据部门ID获取管理用户
Route::put('cveadmin/admin_user/:id/status/:status$', 'cveadmin/adminUser/status')->pattern(['id' => '\d+', 'status' => '\d+',]);//修改管理用户状态
Route::resource('cveadmin/admin_users', 'cveadmin/AdminUser');

Route::resource('cveadmin/admin_member/users','cveadmin/AdminMember');
Route::put('cveadmin/admin_member/users/:id/status/:status$', 'cveadmin/AdminMember/status')->pattern(['id' => '\d+', 'status' => '\d+',]);//修改会员用户状态
Route::get('cveadmin/admin_member/oauth/users$', 'cveadmin/AdminOauthMember/index');//获取第三方用户
Route::delete('cveadmin/admin_member/oauth/users/:id$', 'cveadmin/AdminOauthMember/delete');//删除第三方用户

Route::get('cveadmin/admin_plugin/plugins$', 'cveadmin/AdminPlugin/index');
Route::post('cveadmin/admin_plugin/plugins/:id/status/:status$', 'cveadmin/AdminPlugin/status')->pattern(['id' => '\d+', 'status' => '\d+',]);
Route::get('cveadmin/admin_plugin/plugins/:id/config$', 'cveadmin/AdminPlugin/config')->pattern(['id' => '\d+',]);
Route::put('cveadmin/admin_plugin/plugins/:id/config$', 'cveadmin/AdminPlugin/configPut')->pattern(['id' => '\d+',]);
Route::post('cveadmin/admin_plugin/plugins/:name$', 'cveadmin/AdminPlugin/install');
Route::put('cveadmin/admin_plugin/plugins/:name$', 'cveadmin/AdminPlugin/update');
Route::delete('cveadmin/admin_plugin/plugins/:id$', 'cveadmin/AdminPlugin/uninstall');
Route::get('cveadmin/admin_plugin/plugins/hooks/:id$', 'cveadmin/AdminPlugin/hooks');

Route::delete('cveadmin/admin_setting/cache$', 'cveadmin/AdminSetting/clearCache');
Route::post('cveadmin/admin_setting/site$', 'cveadmin/AdminSetting/sitePut');
Route::put('cveadmin/admin_setting/admin$', 'cveadmin/AdminSetting/adminPut');
Route::put('cveadmin/admin_setting/upload$', 'cveadmin/AdminSetting/uploadPut');
Route::put('cveadmin/admin_setting/storage$', 'cveadmin/AdminSetting/storagePut');
Route::put('cveadmin/admin_setting/password$', 'cveadmin/AdminSetting/passwordPut');
Route::put('cveadmin/admin_setting/lang$', 'cveadmin/AdminSetting/langPut');

Route::put('cveadmin/admin_mail/config$', 'cveadmin/AdminMail/configPut');
Route::put('cveadmin/admin_mail/template$', 'cveadmin/AdminMail/templatePut');

Route::post('cveadmin/admin_themes/:theme/active$', 'cveadmin/AdminTheme/active');
Route::get('cveadmin/admin_themes/not/installed$', 'cveadmin/AdminTheme/notInstalled');
Route::get('cveadmin/admin_themes$', 'cveadmin/AdminTheme/index');
Route::post('cveadmin/admin_themes/:theme$', 'cveadmin/AdminTheme/install');
Route::put('cveadmin/admin_themes/:theme$', 'cveadmin/AdminTheme/update');
Route::delete('cveadmin/admin_themes/:theme$', 'cveadmin/AdminTheme/uninstall');
Route::get('cveadmin/admin_theme/file/var/array$', 'cveadmin/AdminTheme/fileArrayData')->append(['tab'=>'var']);
Route::post('cveadmin/admin_theme/file/var/array$', 'cveadmin/AdminTheme/fileArrayDataEditPost')->append(['tab'=>'var']);
Route::delete('cveadmin/admin_theme/file/var/array$', 'cveadmin/AdminTheme/fileArrayDataDelete')->append(['tab'=>'var']);
Route::get('cveadmin/admin_theme/file/widget/array$', 'cveadmin/AdminTheme/fileArrayData')->append(['tab'=>'widget']);
Route::post('cveadmin/admin_theme/file/widget/array$', 'cveadmin/AdminTheme/fileArrayDataEditPost')->append(['tab'=>'widget']);
Route::delete('cveadmin/admin_theme/file/widget/array$', 'cveadmin/AdminTheme/fileArrayDataDelete')->append(['tab'=>'widget']);
Route::get('cveadmin/admin_theme/file/block/widget/array$', 'cveadmin/AdminTheme/fileArrayData')->append(['tab'=>'block_widget']);
Route::post('cveadmin/admin_theme/file/block/widget/array$', 'cveadmin/AdminTheme/fileArrayDataEditPost')->append(['tab'=>'block_widget']);
Route::delete('cveadmin/admin_theme/file/block/widget/array$', 'cveadmin/AdminTheme/fileArrayDataDelete')->append(['tab'=>'block_widget']);
Route::get('cveadmin/admin_theme/:theme/files$', 'cveadmin/AdminTheme/files');
Route::get('cveadmin/admin_theme/:theme/file/setting$', 'cveadmin/AdminTheme/fileSetting');
Route::post('cveadmin/admin_theme/:theme/file/setting$', 'cveadmin/AdminTheme/fileSettingPost');
Route::get('cveadmin/admin_theme/widget/setting$', 'cveadmin/AdminTheme/widgetSetting');
Route::post('cveadmin/admin_theme/widget/setting$', 'cveadmin/AdminTheme/widgetSettingPost');
Route::post('cveadmin/admin_theme/widgets/sort$', 'cveadmin/AdminTheme/widgetsSort');
Route::post('cveadmin/admin_theme/file/block/widget$', 'cveadmin/AdminTheme/fileWidgetBlockWidgetPost');
Route::get('cveadmin/admin_theme/file/widgets$', 'cveadmin/AdminTheme/fileWidgets');
Route::delete('cveadmin/admin_theme/file/block/widget$', 'cveadmin/AdminTheme/fileWidgetBlockWidgetDelete');

Route::resource('cveadmin/admin_navs', 'cveadmin/AdminNav');
Route::resource('cveadmin/admin_nav/menus', 'cveadmin/AdminNavMenu');
Route::post('cveadmin/admin_nav/menus/:id/toggle$', 'cveadmin/AdminNavMenu/toggle')->pattern(['id' => '\d+',]);
Route::post('cveadmin/admin_nav/menus/:id/status/:status$', 'cveadmin/AdminNavMenu/status')->pattern(['id' => '\d+', 'status' => '\d+',]);
Route::post('cveadmin/admin_nav/menus/list/order$', 'cveadmin/AdminNavMenu/listOrder');
Route::get('cveadmin/admin_navs/select/navs', 'cveadmin/AdminNav/selectNavs');

Route::resource('cveadmin/admin_slides', 'cveadmin/AdminSlide');
Route::resource('cveadmin/admin_slide/items', 'cveadmin/AdminSlideItem');
Route::post('cveadmin/admin_slide/items/:id/toggle$', 'cveadmin/AdminSlideItem/toggle')->pattern(['id' => '\d+',]);
Route::post('cveadmin/admin_slide/items/:id/status/:status$', 'cveadmin/AdminSlideItem/status')->pattern(['id' => '\d+', 'status' => '\d+',]);
Route::post('cveadmin/admin_slide/items/list/order$', 'cveadmin/AdminSlideItem/listOrder');

Route::resource('cveadmin/admin_links', 'cveadmin/AdminLink');
Route::post('cveadmin/admin_links/list/order$', 'cveadmin/AdminLink/listOrder');
Route::post('cveadmin/admin_links/:id/status/:status$', 'cveadmin/AdminLink/status')->pattern(['id' => '\d+', 'status' => '\d+',]);
Route::post('cveadmin/admin_links/status/:status$', 'cveadmin/AdminLink/status')->pattern(['status' => '\d+',]);

Route::resource('cveadmin/admin_routes', 'cveadmin/AdminRoute');
Route::post('cveadmin/admin_routes/:id/toggle$', 'cveadmin/AdminRoute/toggle')->pattern(['id' => '\d+',]);
Route::post('cveadmin/admin_routes/:id/status/:status$', 'cveadmin/AdminRoute/status')->pattern(['id' => '\d+', 'status' => '\d+',]);
Route::post('cveadmin/admin_routes/list/order$', 'cveadmin/AdminRoute/listOrder');
Route::get('cveadmin/admin_routes/app/urls$', 'cveadmin/AdminRoute/appUrls');

Route::get('cveadmin/admin_appstore/plugins', 'cveadmin/AdminAppStore/plugins');
Route::get('cveadmin/admin_appstore/themes', 'cveadmin/AdminAppStore/themes');
Route::get('cveadmin/admin_appstore/islogin$', 'cveadmin/AdminAppStore/checkLogin');
Route::post('cveadmin/admin_appstore/login$', 'cveadmin/AdminAppStore/doLogin');
Route::resource('cveadmin/admin_appstore', 'cveadmin/AdminAppStore');
Route::get('cveadmin/admin_appstore/install/app/:id$', 'cveadmin/AdminAppStore/installApp')->pattern(['id' => '\d+',]);
Route::get('cveadmin/admin_appstore/install/plugin/:id$', 'cveadmin/AdminAppStore/installPlugin')->pattern(['id' => '\d+',]);
Route::get('cveadmin/admin_appstore/install/theme/:id$', 'cveadmin/AdminAppStore/installTheme')->pattern(['id' => '\d+',]);